core: Move triggers into separate binary: ostree-run-triggers
authorColin Walters <walters@verbum.org>
Fri, 13 Jan 2012 20:08:27 +0000 (15:08 -0500)
committerColin Walters <walters@verbum.org>
Fri, 13 Jan 2012 20:08:27 +0000 (15:08 -0500)
I'm trying to keep ostree as being closer to just being the versioning
filesystem, so let's split out the triggers into a different binary
(although still namespaced ostree-).

29 files changed:
Makefile-libostree.am
Makefile-ostree.am
Makefile-triggers.am
src/libostree/ostree-checkout.c [deleted file]
src/libostree/ostree-checkout.h [deleted file]
src/libostree/ostree.h
src/ostree/main.c
src/ostree/ot-builtin-checkout.c
src/ostree/ot-builtin-compose.c
src/ostree/ot-builtin-remote.c
src/ostree/ot-builtin-run-triggers.c [deleted file]
src/ostree/ot-builtins.h
src/triggers/ostree-run-triggers.c [new file with mode: 0644]
src/triggers/triggers.d/desktop-database.trigger [new file with mode: 0755]
src/triggers/triggers.d/gdk-pixbuf.trigger [new file with mode: 0755]
src/triggers/triggers.d/glib.trigger [new file with mode: 0755]
src/triggers/triggers.d/gtk+.trigger [new file with mode: 0755]
src/triggers/triggers.d/immodules.trigger [new file with mode: 0755]
src/triggers/triggers.d/ldconfig.trigger [new file with mode: 0755]
src/triggers/triggers.d/mime-database.trigger [new file with mode: 0755]
src/triggers/triggers.d/pango.trigger [new file with mode: 0755]
triggers.d/desktop-database.trigger [deleted file]
triggers.d/gdk-pixbuf.trigger [deleted file]
triggers.d/glib.trigger [deleted file]
triggers.d/gtk+.trigger [deleted file]
triggers.d/immodules.trigger [deleted file]
triggers.d/ldconfig.trigger [deleted file]
triggers.d/mime-database.trigger [deleted file]
triggers.d/pango.trigger [deleted file]

index adcddf7702d882495bbba05246d262547fae48a4..20af32cfa95a45901a0c0fbdb08362fa98be6b41 100644 (file)
@@ -30,8 +30,6 @@ libostree_la_SOURCES = src/libostree/ostree.h \
        src/libostree/ostree-repo-file.h \
        src/libostree/ostree-repo-file-enumerator.c \
        src/libostree/ostree-repo-file-enumerator.h \
-       src/libostree/ostree-checkout.c \
-       src/libostree/ostree-checkout.h \
        $(NULL)
 if USE_LIBARCHIVE
 libostree_la_SOURCES += src/libostree/ostree-libarchive-input-stream.h \
index 8c8f8a2ff889b7a8e5090315ebc91334c02a14b6..4d10bc2245586ee1438fe8dc44ba52e4f2f49ad0 100644 (file)
@@ -31,7 +31,6 @@ ostree_SOURCES = src/ostree/main.c \
        src/ostree/ot-builtin-local-clone.c \
        src/ostree/ot-builtin-log.c \
        src/ostree/ot-builtin-ls.c \
-       src/ostree/ot-builtin-run-triggers.c \
        src/ostree/ot-builtin-remote.c \
        src/ostree/ot-builtin-rev-parse.c \
        src/ostree/ot-builtin-show.c \
index 96beff0d935d97712a0bd48b45ed705ca966ac32..83af6ce79da1e9b5e19f7649800e21e12e2b3d65 100644 (file)
 
 triggersdir = $(libexecdir)/ostree/triggers.d
 triggers_SCRIPTS = \
-       triggers.d/desktop-database.trigger \
-       triggers.d/gdk-pixbuf.trigger \
-       triggers.d/glib.trigger \
-       triggers.d/gtk+.trigger \
-       triggers.d/immodules.trigger \
-       triggers.d/ldconfig.trigger \
-       triggers.d/mime-database.trigger \
-       triggers.d/pango.trigger \
+       src/triggers/triggers.d/desktop-database.trigger \
+       src/triggers/triggers.d/gdk-pixbuf.trigger \
+       src/triggers/triggers.d/glib.trigger \
+       src/triggers/triggers.d/gtk+.trigger \
+       src/triggers/triggers.d/immodules.trigger \
+       src/triggers/triggers.d/ldconfig.trigger \
+       src/triggers/triggers.d/mime-database.trigger \
+       src/triggers/triggers.d/pango.trigger \
        $(NULL)
+
+bin_PROGRAMS += ostree-run-triggers
+
+ostree_run_triggers_SOURCES = src/triggers/ostree-run-triggers.c
+ostree_run_triggers_CFLAGS = $(OT_DEP_GIO_UNIX_CFLAGS)
+ostree_run_triggers_LDFLAGS = $(OT_DEP_GIO_UNIX_LIBS)
diff --git a/src/libostree/ostree-checkout.c b/src/libostree/ostree-checkout.c
deleted file mode 100644 (file)
index c4977ac..0000000
+++ /dev/null
@@ -1,361 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
- *
- * Copyright (C) 2011 Colin Walters <walters@verbum.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Colin Walters <walters@verbum.org>
- */
-
-#include "config.h"
-
-#include "ostree.h"
-#include "otutil.h"
-
-enum {
-  PROP_0,
-
-  PROP_REPO,
-  PROP_PATH
-};
-
-G_DEFINE_TYPE (OstreeCheckout, ostree_checkout, G_TYPE_OBJECT)
-
-#define GET_PRIVATE(o) \
-  (G_TYPE_INSTANCE_GET_PRIVATE ((o), OSTREE_TYPE_CHECKOUT, OstreeCheckoutPrivate))
-
-typedef struct _OstreeCheckoutPrivate OstreeCheckoutPrivate;
-
-struct _OstreeCheckoutPrivate {
-  OstreeRepo *repo;
-  char *path;
-};
-
-static void
-ostree_checkout_finalize (GObject *object)
-{
-  OstreeCheckout *self = OSTREE_CHECKOUT (object);
-  OstreeCheckoutPrivate *priv = GET_PRIVATE (self);
-
-  g_free (priv->path);
-  g_clear_object (&priv->repo);
-
-  G_OBJECT_CLASS (ostree_checkout_parent_class)->finalize (object);
-}
-
-static void
-ostree_checkout_set_property(GObject         *object,
-                          guint            prop_id,
-                          const GValue    *value,
-                          GParamSpec      *pspec)
-{
-  OstreeCheckout *self = OSTREE_CHECKOUT (object);
-  OstreeCheckoutPrivate *priv = GET_PRIVATE (self);
-
-  switch (prop_id)
-    {
-    case PROP_PATH:
-      priv->path = g_value_dup_string (value);
-      break;
-    case PROP_REPO:
-      priv->repo = g_value_dup_object (value);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-static void
-ostree_checkout_get_property(GObject         *object,
-                          guint            prop_id,
-                          GValue          *value,
-                          GParamSpec      *pspec)
-{
-  OstreeCheckout *self = OSTREE_CHECKOUT (object);
-  OstreeCheckoutPrivate *priv = GET_PRIVATE (self);
-
-  switch (prop_id)
-    {
-    case PROP_PATH:
-      g_value_set_string (value, priv->path);
-      break;
-    case PROP_REPO:
-      g_value_set_object (value, priv->repo);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-static GObject *
-ostree_checkout_constructor (GType                  gtype,
-                           guint                  n_properties,
-                           GObjectConstructParam *properties)
-{
-  GObject *object;
-  GObjectClass *parent_class;
-  OstreeCheckoutPrivate *priv;
-
-  parent_class = G_OBJECT_CLASS (ostree_checkout_parent_class);
-  object = parent_class->constructor (gtype, n_properties, properties);
-
-  priv = GET_PRIVATE (object);
-
-  g_assert (priv->path != NULL);
-  
-  return object;
-}
-
-static void
-ostree_checkout_class_init (OstreeCheckoutClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-  g_type_class_add_private (klass, sizeof (OstreeCheckoutPrivate));
-
-  object_class->constructor = ostree_checkout_constructor;
-  object_class->get_property = ostree_checkout_get_property;
-  object_class->set_property = ostree_checkout_set_property;
-  object_class->finalize = ostree_checkout_finalize;
-
-  g_object_class_install_property (object_class,
-                                   PROP_PATH,
-                                   g_param_spec_string ("path", "", "",
-                                                        NULL,
-                                                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-  g_object_class_install_property (object_class,
-                                   PROP_REPO,
-                                   g_param_spec_object ("repo", "", "",
-                                                        OSTREE_TYPE_REPO,
-                                                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-}
-
-static void
-ostree_checkout_init (OstreeCheckout *self)
-{
-}
-
-OstreeCheckout*
-ostree_checkout_new (OstreeRepo  *repo,
-                     const char  *path)
-{
-  return g_object_new (OSTREE_TYPE_CHECKOUT, "repo", repo, "path", path, NULL);
-}
-
-static gboolean
-executable_exists_in_checkout (const char *path,
-                               const char *executable)
-{
-  int i;
-  const char *subdirs[] = {"bin", "sbin", "usr/bin", "usr/sbin"};
-
-  for (i = 0; i < G_N_ELEMENTS (subdirs); i++)
-    {
-      char *possible_path = g_build_filename (path, subdirs[i], executable, NULL);
-      gboolean exists;
-      
-      exists = g_file_test (possible_path, G_FILE_TEST_EXISTS);
-      g_free (possible_path);
-
-      if (exists)
-        return TRUE;
-    }
-
-  return FALSE;
-}
-
-static gboolean
-run_trigger (OstreeCheckout *self,
-             GFile          *trigger,
-             gboolean        requires_chroot,
-             GError        **error)
-{
-  OstreeCheckoutPrivate *priv = GET_PRIVATE (self);
-  gboolean ret = FALSE;
-  const char *path = NULL;
-  char *temp_path = NULL;
-  char *rel_temp_path = NULL;
-  GFile *temp_copy = NULL;
-  char *basename = NULL;
-  GPtrArray *args = NULL;
-  int estatus;
-
-  path = ot_gfile_get_path_cached (trigger);
-  basename = g_path_get_basename (path);
-
-  args = g_ptr_array_new ();
-  
-  if (requires_chroot)
-    {
-      temp_path = g_build_filename (priv->path, basename, NULL);
-      rel_temp_path = g_strconcat ("./", basename, NULL);
-      temp_copy = ot_gfile_new_for_path (temp_path);
-
-      if (!g_file_copy (trigger, temp_copy, 0, NULL, NULL, NULL, error))
-        goto out;
-
-      g_ptr_array_add (args, "chroot");
-      g_ptr_array_add (args, ".");
-      g_ptr_array_add (args, rel_temp_path);
-      g_ptr_array_add (args, NULL);
-    }
-  else
-    {
-      g_ptr_array_add (args, (char*)path);
-      g_ptr_array_add (args, NULL);
-    }
-      
-  g_print ("Running trigger: %s\n", path);
-  if (!g_spawn_sync (priv->path,
-                     (char**)args->pdata,
-                     NULL,
-                     G_SPAWN_SEARCH_PATH,
-                     NULL, NULL, NULL, NULL,
-                     &estatus,
-                     error))
-    {
-      g_prefix_error (error, "Failed to run trigger %s: ", basename);
-      goto out;
-    }
-
-  ret = TRUE;
- out:
-  if (requires_chroot && temp_path)
-    (void)unlink (temp_path);
-    
-  g_free (basename);
-  g_free (temp_path);
-  g_free (rel_temp_path);
-  g_clear_object (&temp_copy);
-  if (args)
-    g_ptr_array_free (args, TRUE);
-  return ret;
-}
-
-static gboolean
-check_trigger (OstreeCheckout *self,
-               GFile          *trigger,
-               GError        **error)
-{
-  OstreeCheckoutPrivate *priv = GET_PRIVATE (self);
-  gboolean ret = FALSE;
-  GInputStream *instream = NULL;
-  GDataInputStream *datain = NULL;
-  GError *temp_error = NULL;
-  char *line;
-  gsize len;
-  gboolean requires_chroot = TRUE;
-  gboolean matches = FALSE;
-
-  instream = (GInputStream*)g_file_read (trigger, NULL, error);
-  if (!instream)
-    goto out;
-  datain = g_data_input_stream_new (instream);
-
-  while ((line = g_data_input_stream_read_line (datain, &len, NULL, &temp_error)) != NULL)
-    {
-      if (g_str_has_prefix (line, "# IfExecutable: "))
-        {
-          char *executable = g_strdup (line + strlen ("# IfExecutable: "));
-          g_strchomp (executable);
-          matches = executable_exists_in_checkout (priv->path, executable);
-          g_free (executable);
-        }
-
-      g_free (line);
-    }
-  if (line == NULL && temp_error != NULL)
-    {
-      g_propagate_error (error, temp_error);
-      goto out;
-    }
-  if (matches)
-    {
-      if (!run_trigger (self, trigger, requires_chroot, error))
-        goto out;
-    }
-  
-  ret = TRUE;
- out:
-  g_clear_object (&instream);
-  g_clear_object (&datain);
-  return ret;
-}
-
-gboolean
-ostree_checkout_run_triggers (OstreeCheckout *self,
-                              GError        **error)
-{
-  gboolean ret = FALSE;
-  GError *temp_error = NULL;
-  char *triggerdir_path = NULL;
-  GFile *triggerdir = NULL;
-  GFileInfo *file_info = NULL;
-  GFileEnumerator *enumerator = NULL;
-
-  triggerdir_path = g_build_filename (LIBEXECDIR, "ostree", "triggers.d", NULL);
-  triggerdir = ot_gfile_new_for_path (triggerdir_path);
-
-  enumerator = g_file_enumerate_children (triggerdir, OSTREE_GIO_FAST_QUERYINFO, 
-                                          G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
-                                          NULL, 
-                                          error);
-  if (!enumerator)
-    goto out;
-
-  while ((file_info = g_file_enumerator_next_file (enumerator, NULL, &temp_error)) != NULL)
-    {
-      const char *name;
-      guint32 type;
-      char *child_path = NULL;
-      GFile *child = NULL;
-      gboolean success;
-
-      name = g_file_info_get_attribute_byte_string (file_info, "standard::name"); 
-      type = g_file_info_get_attribute_uint32 (file_info, "standard::type");
-      
-      if (type == G_FILE_TYPE_REGULAR && g_str_has_suffix (name, ".trigger"))
-        {
-          child_path = g_build_filename (triggerdir_path, name, NULL);
-          child = ot_gfile_new_for_path (child_path);
-
-          success = check_trigger (self, child, error);
-        }
-      else
-        success = TRUE;
-
-      g_object_unref (file_info);
-      g_free (child_path);
-      g_clear_object (&child);
-      if (!success)
-        goto out;
-    }
-  if (file_info == NULL && temp_error != NULL)
-    {
-      g_propagate_error (error, temp_error);
-      goto out;
-    }
-
-  ret = TRUE;
- out:
-  g_free (triggerdir_path);
-  g_clear_object (&triggerdir);
-  g_clear_object (&enumerator);
-  return ret;
-}
diff --git a/src/libostree/ostree-checkout.h b/src/libostree/ostree-checkout.h
deleted file mode 100644 (file)
index 042cdc8..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
- *
- * Copyright (C) 2011 Colin Walters <walters@verbum.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Colin Walters <walters@verbum.org>
- */
-
-#ifndef _OSTREE_CHECKOUT
-#define _OSTREE_CHECKOUT
-
-#include <ostree-repo.h>
-
-G_BEGIN_DECLS
-
-#define OSTREE_TYPE_CHECKOUT ostree_checkout_get_type()
-#define OSTREE_CHECKOUT(obj) \
-  (G_TYPE_CHECK_INSTANCE_CAST ((obj), OSTREE_TYPE_CHECKOUT, OstreeCheckout))
-#define OSTREE_CHECKOUT_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_CAST ((klass), OSTREE_TYPE_CHECKOUT, OstreeCheckoutClass))
-#define OSTREE_IS_CHECKOUT(obj) \
-  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OSTREE_TYPE_CHECKOUT))
-#define OSTREE_IS_CHECKOUT_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_TYPE ((klass), OSTREE_TYPE_CHECKOUT))
-#define OSTREE_CHECKOUT_GET_CLASS(obj) \
-  (G_TYPE_INSTANCE_GET_CLASS ((obj), OSTREE_TYPE_CHECKOUT, OstreeCheckoutClass))
-
-typedef struct {
-  GObject parent;
-} OstreeCheckout;
-
-typedef struct {
-  GObjectClass parent_class;
-} OstreeCheckoutClass;
-
-GType ostree_checkout_get_type (void);
-
-OstreeCheckout* ostree_checkout_new (OstreeRepo  *repo,
-                                     const char  *path);
-
-gboolean ostree_checkout_run_triggers (OstreeCheckout *checkout,
-                                       GError        **error);
-
-G_END_DECLS
-
-#endif /* _OSTREE_CHECKOUT */
index abd71a32dba2d9c0fde4adc47fc1a6e8de1bf6b2..bf4153aebdf482b599837a424b2b02c0c1704a0f 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <ostree-core.h>
 #include <ostree-repo.h>
-#include <ostree-checkout.h>
 #include <ostree-mutable-tree.h>
 #include <ostree-repo-file.h>
 
index 301a512dfe10e1c7c8d414a1ac6ea9c8f69400e7..3818029fcd14739ec87ab29625831bc850ff42fd 100644 (file)
@@ -43,7 +43,6 @@ static OstreeBuiltin builtins[] = {
   { "remote", ostree_builtin_remote, 0 },
   { "rev-parse", ostree_builtin_rev_parse, 0 },
   { "remote", ostree_builtin_remote, 0 },
-  { "run-triggers", ostree_builtin_run_triggers, 0 },
   { "show", ostree_builtin_show, 0 },
   { NULL }
 };
index 3fd40456cb25809a364b4849336207ae202a4df0..052602311faec1a0c183768655e489e1e75e535e 100644 (file)
@@ -40,7 +40,6 @@ ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GError **error
   GOptionContext *context;
   gboolean ret = FALSE;
   OstreeRepo *repo = NULL;
-  OstreeCheckout *checkout = NULL;
   const char *commit;
   const char *destination;
   GFile *destf = NULL;
@@ -79,7 +78,6 @@ ostree_builtin_checkout (int argc, char **argv, GFile *repo_path, GError **error
   if (context)
     g_option_context_free (context);
   g_clear_object (&repo);
-  g_clear_object (&checkout);
   g_clear_object (&destf);
   return ret;
 }
index a0c51fb1c80c876f5a4708237b6dd6959ac263a4..30d0aec04e5c30ab9e95bb6eb96456f4e6bf63c0 100644 (file)
@@ -93,7 +93,6 @@ ostree_builtin_compose (int argc, char **argv, GFile *repo_path, GError **error)
   GOptionContext *context;
   gboolean ret = FALSE;
   OstreeRepo *repo = NULL;
-  OstreeCheckout *checkout = NULL;
   char *parent = NULL;
   GFile *destf = NULL;
   GHashTable *seen_branches = NULL;
@@ -286,7 +285,6 @@ ostree_builtin_compose (int argc, char **argv, GFile *repo_path, GError **error)
   if (parent_commit_compose_iter)
     g_variant_iter_free (parent_commit_compose_iter);
   g_clear_object (&repo);
-  g_clear_object (&checkout);
   g_clear_object (&destf);
   g_clear_object (&metadata_f);
   g_clear_object (&mtree);
index 41510bc535e4d3494e4e1c91319cf097a730ef14..6ec33460daed8e2f58a0c6d2fd8fb36143865113 100644 (file)
@@ -47,7 +47,6 @@ ostree_builtin_remote (int argc, char **argv, GFile *repo_path, GError **error)
   GOptionContext *context;
   gboolean ret = FALSE;
   OstreeRepo *repo = NULL;
-  OstreeCheckout *checkout = NULL;
   const char *op;
   GKeyFile *config = NULL;
 
@@ -99,6 +98,5 @@ ostree_builtin_remote (int argc, char **argv, GFile *repo_path, GError **error)
   if (config)
     g_key_file_free (config);
   g_clear_object (&repo);
-  g_clear_object (&checkout);
   return ret;
 }
diff --git a/src/ostree/ot-builtin-run-triggers.c b/src/ostree/ot-builtin-run-triggers.c
deleted file mode 100644 (file)
index d5be7a3..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
- *
- * Copyright (C) 2011 Colin Walters <walters@verbum.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Colin Walters <walters@verbum.org>
- */
-
-#include "config.h"
-
-#include "ot-builtins.h"
-#include "ostree.h"
-
-#include <glib/gi18n.h>
-
-static gboolean quiet;
-
-static GOptionEntry options[] = {
-  { "quiet", 'q', 0, G_OPTION_ARG_NONE, &quiet, "Don't display informational messages", NULL },
-  { NULL }
-};
-
-gboolean
-ostree_builtin_run_triggers (int argc, char **argv, GFile *repo_path, GError **error)
-{
-  GOptionContext *context;
-  gboolean ret = FALSE;
-  OstreeRepo *repo = NULL;
-  OstreeCheckout *checkout = NULL;
-  const char *dir;
-
-  context = g_option_context_new ("DIR - Run trigger scripts for directory");
-  g_option_context_add_main_entries (context, options, NULL);
-
-  if (!g_option_context_parse (context, &argc, &argv, error))
-    goto out;
-
-  repo = ostree_repo_new (repo_path);
-  if (!ostree_repo_check (repo, error))
-    goto out;
-
-  if (argc < 1)
-    {
-      gchar *help = g_option_context_get_help (context, TRUE, NULL);
-      g_printerr ("%s\n", help);
-      g_free (help);
-      g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
-                           "DIR must be specified");
-      goto out;
-    }
-
-  dir = argv[1];
-
-  checkout = ostree_checkout_new (repo, dir);
-  if (!ostree_checkout_run_triggers (checkout, error))
-    goto out;
-  ret = TRUE;
- out:
-  if (context)
-    g_option_context_free (context);
-  g_clear_object (&repo);
-  g_clear_object (&checkout);
-  return ret;
-}
index acf2406cebc48033aa37e6a9506c9aaf98d5103a..b49a905f1df48483d88e67b2054c5a361025ec25 100644 (file)
@@ -36,7 +36,6 @@ gboolean ostree_builtin_init (int argc, char **argv, GFile *repo_path, GError **
 gboolean ostree_builtin_local_clone (int argc, char **argv, GFile *repo_path, GError **error);
 gboolean ostree_builtin_log (int argc, char **argv, GFile *repo_path, GError **error);
 gboolean ostree_builtin_ls (int argc, char **argv, GFile *repo_path, GError **error);
-gboolean ostree_builtin_run_triggers (int argc, char **argv, GFile *repo_path, GError **error);
 gboolean ostree_builtin_fsck (int argc, char **argv, GFile *repo_path, GError **error);
 gboolean ostree_builtin_show (int argc, char **argv, GFile *repo_path, GError **error);
 gboolean ostree_builtin_rev_parse (int argc, char **argv, GFile *repo_path, GError **error);
diff --git a/src/triggers/ostree-run-triggers.c b/src/triggers/ostree-run-triggers.c
new file mode 100644 (file)
index 0000000..29f036b
--- /dev/null
@@ -0,0 +1,221 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2011,2012 Colin Walters <walters@verbum.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Colin Walters <walters@verbum.org>
+ */
+
+#include "config.h"
+
+#include <gio/gio.h>
+#include <string.h>
+
+static gboolean quiet;
+
+static GOptionEntry options[] = {
+  { "quiet", 'q', 0, G_OPTION_ARG_NONE, &quiet, "Don't display informational messages", NULL },
+  { NULL }
+};
+
+static gboolean
+run_trigger (const char     *path,
+             GError        **error)
+{
+  gboolean ret = FALSE;
+  char *basename = NULL;
+  GPtrArray *args = NULL;
+  int estatus;
+
+  basename = g_path_get_basename (path);
+
+  args = g_ptr_array_new ();
+  
+  g_ptr_array_add (args, (char*)path);
+  g_ptr_array_add (args, NULL);
+      
+  g_print ("Running trigger: %s\n", path);
+  if (!g_spawn_sync (NULL,
+                     (char**)args->pdata,
+                     NULL,
+                     0,
+                     NULL, NULL, NULL, NULL,
+                     &estatus,
+                     error))
+    {
+      g_prefix_error (error, "Failed to run trigger %s: ", basename);
+      goto out;
+    }
+
+  ret = TRUE;
+ out:
+  g_free (basename);
+  if (args)
+    g_ptr_array_free (args, TRUE);
+  return ret;
+}
+
+static gboolean
+check_trigger (GFile          *trigger,
+               GError        **error)
+{
+  gboolean ret = FALSE;
+  GInputStream *instream = NULL;
+  GDataInputStream *datain = NULL;
+  GError *temp_error = NULL;
+  char *line;
+  gsize len;
+  char *ifexecutable_path = NULL;
+  char *trigger_path = NULL;
+  gboolean matched = TRUE;
+
+  trigger_path = g_file_get_path (trigger);
+
+  instream = (GInputStream*)g_file_read (trigger, NULL, error);
+  if (!instream)
+    goto out;
+  datain = g_data_input_stream_new (instream);
+
+  while ((line = g_data_input_stream_read_line (datain, &len, NULL, &temp_error)) != NULL)
+    {
+      if (g_str_has_prefix (line, "# IfExecutable: "))
+        {
+          char *executable = g_strdup (line + strlen ("# IfExecutable: "));
+          g_strchomp (executable);
+          g_free (ifexecutable_path);
+          ifexecutable_path = g_find_program_in_path (executable);
+          g_free (executable);
+          if (!ifexecutable_path)
+            {
+              matched = FALSE;
+              break;
+            }
+          break;
+        }
+      g_free (line);
+    }
+  if (line == NULL && temp_error != NULL)
+    {
+      g_propagate_error (error, temp_error);
+      goto out;
+    }
+  if (matched)
+    {
+      if (!run_trigger (trigger_path, error))
+        goto out;
+    }
+  
+  ret = TRUE;
+ out:
+  g_free (trigger_path);
+  g_free (ifexecutable_path);
+  g_clear_object (&instream);
+  g_clear_object (&datain);
+  return ret;
+}
+
+
+gboolean
+run_triggers (GError        **error)
+{
+  gboolean ret = FALSE;
+  GError *temp_error = NULL;
+  char *triggerdir_path = NULL;
+  GFile *triggerdir = NULL;
+  GFileInfo *file_info = NULL;
+  GFileEnumerator *enumerator = NULL;
+
+  triggerdir_path = g_build_filename (LIBEXECDIR, "ostree", "triggers.d", NULL);
+  triggerdir = g_file_new_for_path (triggerdir_path);
+
+  enumerator = g_file_enumerate_children (triggerdir, "standard::name,standard::type", 
+                                          G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+                                          NULL, 
+                                          error);
+  if (!enumerator)
+    goto out;
+
+  while ((file_info = g_file_enumerator_next_file (enumerator, NULL, &temp_error)) != NULL)
+    {
+      const char *name;
+      guint32 type;
+      char *child_path = NULL;
+      GFile *child = NULL;
+      gboolean success;
+
+      name = g_file_info_get_attribute_byte_string (file_info, "standard::name"); 
+      type = g_file_info_get_attribute_uint32 (file_info, "standard::type");
+      
+      if (type == G_FILE_TYPE_REGULAR && g_str_has_suffix (name, ".trigger"))
+        {
+          child_path = g_build_filename (triggerdir_path, name, NULL);
+          child = g_file_new_for_path (child_path);
+
+          success = check_trigger (child, error);
+        }
+      else
+        success = TRUE;
+
+      g_object_unref (file_info);
+      g_free (child_path);
+      g_clear_object (&child);
+      if (!success)
+        goto out;
+    }
+  if (file_info == NULL && temp_error != NULL)
+    {
+      g_propagate_error (error, temp_error);
+      goto out;
+    }
+
+  ret = TRUE;
+ out:
+  g_free (triggerdir_path);
+  g_clear_object (&triggerdir);
+  g_clear_object (&enumerator);
+  return ret;
+}
+
+int
+main (int    argc,
+      char **argv)
+{
+  GOptionContext *context;
+  GError *real_error = NULL;
+  GError **error = &real_error;
+  gboolean ret = FALSE;
+
+  g_type_init ();
+
+  context = g_option_context_new ("- Regenerate caches in operating system tree");
+  g_option_context_add_main_entries (context, options, NULL);
+
+  if (!g_option_context_parse (context, &argc, &argv, error))
+    goto out;
+
+  if (!run_triggers (error))
+    goto out;
+
+  ret = TRUE;
+ out:
+  if (real_error)
+    g_printerr ("%s\n", real_error->message);
+  g_clear_error (&real_error);
+  if (!ret)
+    return 1;
+  return 0;
+}
diff --git a/src/triggers/triggers.d/desktop-database.trigger b/src/triggers/triggers.d/desktop-database.trigger
new file mode 100755 (executable)
index 0000000..017d27c
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Post-installation hook for desktop files.  -*- mode: sh -*-
+#
+# Written by Matthias Clasen <mclasen@redhat.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# IfExecutable: update-desktop-database
+# REMatch: /share/applications/.*/.*\.desktop
+
+exec update-desktop-database -q ./usr/share/applications
diff --git a/src/triggers/triggers.d/gdk-pixbuf.trigger b/src/triggers/triggers.d/gdk-pixbuf.trigger
new file mode 100755 (executable)
index 0000000..07c84b0
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+# Post-installation hook for gdk-pixbuf.  -*- mode: sh -*-
+# Corresponds to gdk-pixbuf/gdk-pixbuf/Makefile.am:install-data-hook
+#
+# Written by Colin Walters <walters@verbum.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# IfExecutable: gdk-pixbuf-query-loaders
+# RequiresChroot: true
+# LiteralMatch: /gdk-pixbuf-2.0/2.10.0/loaders/
+
+exec gdk-pixbuf-query-loaders --update-cache
diff --git a/src/triggers/triggers.d/glib.trigger b/src/triggers/triggers.d/glib.trigger
new file mode 100755 (executable)
index 0000000..734b672
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Post-installation hook for glib/gschema.  -*- mode: sh -*-
+#
+# Written by Colin Walters <walters@verbum.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# IfExecutable: glib-compile-schemas
+# LiteralMatch: /share/glib-2.0/schemas/
+
+exec glib-compile-schemas ./usr/share/glib-2.0/schemas
diff --git a/src/triggers/triggers.d/gtk+.trigger b/src/triggers/triggers.d/gtk+.trigger
new file mode 100755 (executable)
index 0000000..26b313f
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+# Post-installation hook for gtk icon cache.  -*- mode: sh -*-
+#
+# Written by Colin Walters <walters@verbum.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# IfExecutable: gtk-update-icon-cache
+# LiteralMatch: /share/icons/
+
+for dir in ./usr/share/icons/*; do
+  if test -f $dir/index.theme; then
+    if ! gtk-update-icon-cache --quiet $dir; then
+       echo "Failed to run gtk-update-icon-cache for $dir"
+       exit 1
+    fi
+  fi
+done
diff --git a/src/triggers/triggers.d/immodules.trigger b/src/triggers/triggers.d/immodules.trigger
new file mode 100755 (executable)
index 0000000..daad42a
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Post-installation hook for GTK+ input method modules.  -*- mode: sh -*-
+#
+# Written by Matthias Clasen <mclasen@redhat.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# IfExecutable: gtk-query-immodules-3.0
+# REMatch: /lib.*/gtk-3\.0/3\.0\.0/immodules/.*\.so
+
+gtk-query-immodules-3.0 --update-cache
diff --git a/src/triggers/triggers.d/ldconfig.trigger b/src/triggers/triggers.d/ldconfig.trigger
new file mode 100755 (executable)
index 0000000..b412603
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Post-installation hook for shared libraries.  -*- mode: sh -*-
+#
+# Written by Colin Walters <walters@verbum.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# IfExecutable: ldconfig
+# REMatch: /lib.*/\.so.*
+
+ldconfig -r .
diff --git a/src/triggers/triggers.d/mime-database.trigger b/src/triggers/triggers.d/mime-database.trigger
new file mode 100755 (executable)
index 0000000..bfe301f
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Post-installation hook for shared-mime-info.  -*- mode: sh -*-
+#
+# Written by Matthias Clasen <mclasen@redhat.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# IfExecutable: update-mime-database
+# REMatch: /mime/packages/.*\.xml
+
+exec update-mime-database ./usr/share/mime
diff --git a/src/triggers/triggers.d/pango.trigger b/src/triggers/triggers.d/pango.trigger
new file mode 100755 (executable)
index 0000000..e5e19ce
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+# Post-installation hook for pango.  -*- mode: sh -*-
+# Corresponds to gdk-pixbuf/gdk-pixbuf/Makefile.am:install-data-hook
+#
+# Written by Colin Walters <walters@verbum.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# IfExecutable: pango-querymodules
+# REMatch: /lib.*/pango/.*/modules/.*\.so
+
+DEST=/etc/pango/pango.modules
+pango-querymodules > ${DEST}.tmp && mv ${DEST}.tmp ${DEST}
diff --git a/triggers.d/desktop-database.trigger b/triggers.d/desktop-database.trigger
deleted file mode 100755 (executable)
index 017d27c..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-# Post-installation hook for desktop files.  -*- mode: sh -*-
-#
-# Written by Matthias Clasen <mclasen@redhat.com>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# IfExecutable: update-desktop-database
-# REMatch: /share/applications/.*/.*\.desktop
-
-exec update-desktop-database -q ./usr/share/applications
diff --git a/triggers.d/gdk-pixbuf.trigger b/triggers.d/gdk-pixbuf.trigger
deleted file mode 100755 (executable)
index 07c84b0..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-# Post-installation hook for gdk-pixbuf.  -*- mode: sh -*-
-# Corresponds to gdk-pixbuf/gdk-pixbuf/Makefile.am:install-data-hook
-#
-# Written by Colin Walters <walters@verbum.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# IfExecutable: gdk-pixbuf-query-loaders
-# RequiresChroot: true
-# LiteralMatch: /gdk-pixbuf-2.0/2.10.0/loaders/
-
-exec gdk-pixbuf-query-loaders --update-cache
diff --git a/triggers.d/glib.trigger b/triggers.d/glib.trigger
deleted file mode 100755 (executable)
index 734b672..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-# Post-installation hook for glib/gschema.  -*- mode: sh -*-
-#
-# Written by Colin Walters <walters@verbum.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# IfExecutable: glib-compile-schemas
-# LiteralMatch: /share/glib-2.0/schemas/
-
-exec glib-compile-schemas ./usr/share/glib-2.0/schemas
diff --git a/triggers.d/gtk+.trigger b/triggers.d/gtk+.trigger
deleted file mode 100755 (executable)
index 26b313f..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-# Post-installation hook for gtk icon cache.  -*- mode: sh -*-
-#
-# Written by Colin Walters <walters@verbum.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# IfExecutable: gtk-update-icon-cache
-# LiteralMatch: /share/icons/
-
-for dir in ./usr/share/icons/*; do
-  if test -f $dir/index.theme; then
-    if ! gtk-update-icon-cache --quiet $dir; then
-       echo "Failed to run gtk-update-icon-cache for $dir"
-       exit 1
-    fi
-  fi
-done
diff --git a/triggers.d/immodules.trigger b/triggers.d/immodules.trigger
deleted file mode 100755 (executable)
index daad42a..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-# Post-installation hook for GTK+ input method modules.  -*- mode: sh -*-
-#
-# Written by Matthias Clasen <mclasen@redhat.com>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# IfExecutable: gtk-query-immodules-3.0
-# REMatch: /lib.*/gtk-3\.0/3\.0\.0/immodules/.*\.so
-
-gtk-query-immodules-3.0 --update-cache
diff --git a/triggers.d/ldconfig.trigger b/triggers.d/ldconfig.trigger
deleted file mode 100755 (executable)
index b412603..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-# Post-installation hook for shared libraries.  -*- mode: sh -*-
-#
-# Written by Colin Walters <walters@verbum.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# IfExecutable: ldconfig
-# REMatch: /lib.*/\.so.*
-
-ldconfig -r .
diff --git a/triggers.d/mime-database.trigger b/triggers.d/mime-database.trigger
deleted file mode 100755 (executable)
index bfe301f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-# Post-installation hook for shared-mime-info.  -*- mode: sh -*-
-#
-# Written by Matthias Clasen <mclasen@redhat.com>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# IfExecutable: update-mime-database
-# REMatch: /mime/packages/.*\.xml
-
-exec update-mime-database ./usr/share/mime
diff --git a/triggers.d/pango.trigger b/triggers.d/pango.trigger
deleted file mode 100755 (executable)
index ebd60f4..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-# Post-installation hook for pango.  -*- mode: sh -*-
-# Corresponds to gdk-pixbuf/gdk-pixbuf/Makefile.am:install-data-hook
-#
-# Written by Colin Walters <walters@verbum.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# IfExecutable: pango-querymodules
-# REMatch: /lib.*/pango/.*/modules/.*\.so
-
-OSTREE_ROOT=`pwd`
-DEST=./usr/etc/pango/pango.modules
-pango-querymodules > ${DEST}.tmp && mv ${DEST}.tmp ${DEST}